<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<%@ include file="/commons/commonEdit.jsp"%>
<%@ include file="/commons/validation.jsp"%>
<%@ include file="/commons/fileUpload.jsp" %>
<html>
<script language="JavaScript" type="text/javascript"
	src="${ctx}/scripts/div/common.js"></script>
<script type="text/javascript">

  function submitForm(){
  var isTrue=$("addHouseForm").fireEvent("onSubmit");
  if(isTrue){
  var tempPropertyType="";
   var propertyType=document.getElementsByName("propertyType");
   for (var   i=0;   i<propertyType.length;   i++){
         if(propertyType[i].checked){
            tempPropertyType=tempPropertyType+propertyType[i].value+",";
          }
   }

    document.getElementById("directionId").value=tempPropertyType;

   document.getElementById("addHouseForm").submit();

   }
  }

  function savaAgain(){
  document.getElementById("saveAgain").value="true";
  submitForm();
  }
  function save(){
  document.getElementById("saveAgain").value="false";
  submitForm();
  }

  function closeWindow(){
     if('${hasSaveAgain}'=='true'){
     var iframe=findFrame("mainFrame");
	   iframe.refleshFrame();
     }

     windowClose();
  }


</script>



<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td class="window_head_outBg"><table border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td><img src="${ctx}/images/ico_Advance.gif" width="16" height="16" align="absmiddle"> <span class="window_head_intext">${key.add_room}</span></td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td class="aux_header_line_1"></td>
  </tr>
  <tr>
    <td class="aux_header_line_2"></td>
  </tr>
  <tr>
    <td valign="middle" class="content"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="container_in_show">
      <tr>
        <td valign="top"><div id="tab_Search" >
              <table width="100%" border="0" cellpadding="0" cellspacing="0" id="tab_subMenu1">
              <form id="addHouseForm" name="addHouseForm" method="post" action="${ctx}/house_houseAction.do?method=addHouse" class="required-validate" ENCTYPE="multipart/form-data">
              <input type="hidden" name="buildingId" value="${buildingId}"/>
              <input type="hidden" name="directionId" value=""/>
              <input type="hidden" name="projectId" value="${projectId}"/>
               <input type="hidden" name="saveAgain" value=""/>
                <tr>
                  <td><table width="100%" border="0" align="center" cellpadding="5" cellspacing="0">
                      <tr>
                        <td><table width="100%" border="0" cellpadding="0" cellspacing="1" class="aux_intable_color">
                          <tr>
                            <td class="aux_intable_td1">${key.unit}</td>
                            <td class="aux_intable_require" id="aux_intable_houseGrpid">
                            <pms:unitedSelect id="houseGrpid"
                                              selectText="${key.please_select}"
											name="houseGrpid"
											dataList="${houseGrpList}"
											optionLabel="name"
											className="select-one-required"
											optionValue="keyword" >
							</pms:unitedSelect>
                           </td>
                            <td valign="top" class="aux_intable_td1">${key.construction_area}</td>
                            <td valign="top" class="aux_intable_require"><input name="buildSize" autocomplete="off" type="text" maxLength="12" class="required float-right integer-decimal-range-12-2" value="" size="16" afterInsert="buildSizeSpan">
                              ㎡<span id="buildSizeSpan"></span></td>
                          </tr>
                          <tr>
                            <td class="aux_intable_td1">${key.floor}</td>
                            <td class="aux_intable_require">
                            <pms:unitedSelect id="floor"
                                              selectText="${key.please_select}"
											name="floor"
											dataList="${houseFloorList}"
											className="select-one-required" >
										</pms:unitedSelect>
                            </td>
                            <td valign="top" class="aux_intable_td1">${key.inner_area}</td>
                            <td valign="top" class="aux_intable_require"><input name="innerSize" maxLength="12" type="text" autocomplete="off" class="required float-right integer-decimal-range-12-2 less-than-buildSize" validateMessageLessThan="套内面积不能大于等于建筑面积" value="" size="16" afterInsert="innerSizeSpan">
                              ㎡<span id="innerSizeSpan"></span></td>
                          </tr>
                          <tr>
                            <td valign="top" class="aux_intable_td1">${key.houseNumber}</td>
                            <td valign="top" class="aux_intable_require">
                            <input name="houseNumber" type="text" maxLength="36" class="required validate-char validate-ajax" relativeId="projectId" value="" size="16" validateUrl="${ctx}/house_houseAction.do?method=validationHouseNumber">
                            </td>

                            <td valign="top" class="aux_intable_td1">${key.pool_area}</td>
                            <td valign="top" class="aux_intable_require"><input name="publicSize" autocomplete="off" maxLength="12" type="text" class="required float-right integer-decimal-range-12-2" value="" size="16" afterInsert="publicSizeSpan">
                              ㎡<span id="publicSizeSpan"></span></td>
                          </tr>
                          <tr>
                            <td valign="top" class="aux_intable_td1">${key.apartment}</td>
                            <td valign="top" class="aux_intable_require">
                            <pms:unitedSelect id="housePlanId"
                                              selectText="${key.please_select}"
											name="housePlanId"
											dataList="${housePlanList}"
											optionLabel="name"
											className="select-one-required"
											optionValue="keyword" >
										</pms:unitedSelect>
                                             </td>
                            <td rowspan="2" valign="top" class="aux_intable_td1">${key.towards}</td>
                            <td rowspan="2" valign="top" class="aux_intable_td2">
                            <logic:iterate id="direction" name="directionList"><input type="checkbox" name="propertyType" value="${direction.id}">
                              <bean:write name="direction" property="name"/>&nbsp;&nbsp;
			                </logic:iterate>
						</td>
                          </tr>
                          <tr>
                            <td valign="top" class="aux_intable_td1">${key.jiaofang_standards}</td>
                            <td valign="center" class="aux_intable_require">
                            <pms:unitedSelect id="deliveryLimitationId"
                                              selectText="${key.please_select}"
											name="deliveryLimitationId"
											dataList="${deliveryLimitationList}"
											optionLabel="name"
											className="select-one-required"
											optionValue="id" >
										</pms:unitedSelect>
                            </td>
                            </tr>
                          <tr>
                            <td valign="top" class="aux_intable_td1">${key.housing_floor_plan}</td>
                            <td valign="center" class="aux_intable_td2">
                            <mypms:ImageUpload name="picpath1"  maxNum="1" imageType="jpg,JPG,gif,GIF" postfixName="Ichnograp">
				              </mypms:ImageUpload>
                            </td>
                            <td rowspan="2" valign="top" class="aux_intable_td1">${key.Remarks}</td>
                            <td rowspan="2" valign="top" class="aux_intable_td2"><textarea name="remark" cols="25" rows="4" class="max-length-500"></textarea></td>
                          </tr>
                          <tr>
                            <td valign="top" class="aux_intable_td1">${key.distribution_of_pipeline}</td>
                            <td valign="top" class="aux_intable_td2">	<div>
                             <mypms:ImageUpload name="picpath2"  maxNum="1" imageType="jpg,JPG,gif,GIF" postfixName="Pipeline">
				              </mypms:ImageUpload></td>
                            </tr>


                        </table></td>
                      </tr>

                  </table></td>
                </tr></form>

              </table>

             </div>

             </td>
        </tr>
       </table>
	      </td>
  </tr>
  <tr>
    <td class="window_footer"><table border="0" align="right" cellpadding="0" cellspacing="0">
        <tr>
          <td><table border="0" cellpadding="0" cellspacing="0">
              <tr>
              <td class="buttonOffLeft" id="btn1_41"></td>
              <td class="buttonOffMiddle" id="btn1_42" onClick="savaAgain();" onMouseOver="btn_change_over(4)" onMouseOut="btn_change_out(4)" onblur="btn_change(4)"><img src="${ctx}/images/ico_saveandnewfile.gif" alt="" width="14" height="15" border="0" align="absbottom">${key.saveAgain}</td>
              <td class="buttonOffRight" id="btn1_43"></td>
            </tr>
          </table></td>
		  <td class="btn_between_space"></td>
          <td><table border="0" cellpadding="0" cellspacing="0" >
            <tr>
              <td class="buttonOffLeft" id="btn1_51"></td>
              <td class="buttonOffMiddle" id="btn1_52" onblur="btn_change(5)" onMouseOver="btn_change_over(5)" onMouseOut="btn_change_out(5)" onClick="save();"><img src="${ctx}/images/ico_ok.gif" border="0" align="absmiddle" />${key.save}</td>
              <td class="buttonOffRight" id="btn1_53"></td>
            </tr>
        </table></td>
        <td class="btn_between_space"></td>
        <td><table border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td class="buttonOffLeft" id="btn1_31"></td>
              <td class="buttonOffMiddle" id="btn1_32" onblur="btn_change(3)"  onClick="closeWindow();" onMouseOver="btn_change_over(3)" onMouseOut="btn_change_out(3)"><img src="${ctx}/images/ico_cancel.gif" border="0" align="absmiddle" />${key.close}</td>
              <td class="buttonOffRight" id="btn1_33"></td>
            </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>

</table>

</body>
<script type="text/javascript">
if(document.getElementById("houseGrpid").length==1){

document.getElementById("houseGrpid").disabled=true;
document.getElementById("houseGrpid").className="";
document.getElementById("aux_intable_houseGrpid").className="aux_intable_td2";

}


</script>

</html>